import request from '@/utils/request';

// 薪资透视图-获取透视图配置数据
export async function queryConfig(params) {
    return request('/api/finance/salary/v1/perspectivePic/data/config/get', {
        method: 'POST',
        data: params
    });
}

// 薪资透视图-获取透视图总览统计数据
export async function queryGlobalData(params) {
    return request('/api/finance/salary/v1/perspectivePic/data/global/get', {
        method: 'POST',
        data: params
    });
}

// 薪资透视图-获取透视图具体图表统计数据
export async function queryChartData(params) {
    return request(`/api/finance/salary/v1/perspectivePic/data/special/get/${params.globalType}`, {
        method: 'POST',
        data: params
    });
}

// 薪资透视图-新增或修改总览配置信息
export async function saveGlobalData(params) {
    return request('/api/finance/salary/v1/perspectivePic/global/save', {
        method: 'POST',
        data: params
    });
}

// 薪资透视图-新增或修改具体视图配置信息
export async function saveChartData(params) {
    return request('/api/finance/salary/v1/perspectivePic/special/save', {
        method: 'POST',
        data: params
    });
}

// 薪资透视图-根据据薪资项类型获取薪资项树
export async function querySalaryItemsTree(params) {
    return request(`/api/finance/salary/v1/salaryItem/query/tree/${params.organizationCode}/${params.itemType}/${params.extraType}`, {
        method: 'POST',
        data: params
    });
}
